package 个人密码库.model;

import com.alibaba.excel.annotation.ExcelProperty;
import 个人密码库.util.LocalDateTimeConverter;

import java.time.LocalDateTime;

public class Password {
    @ExcelProperty("编号")
    private int id;
    @ExcelProperty("密码")
    private String password;
    @ExcelProperty("描述")
    private String description;
    @ExcelProperty(value = "更改时间", converter = LocalDateTimeConverter.class)
    private LocalDateTime modificationDate;

    public int getId() {
        return id;
    }

    public String getPassword() {
        return password;
    }

    public String getDescription() {
        return description;
    }

    public LocalDateTime getModificationDate() {
        if (modificationDate == null) {
            return LocalDateTime.now();
        }
        return modificationDate;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setModificationDate(LocalDateTime modificationDate) {
        this.modificationDate = modificationDate;
    }
}
